package ta.client;

import gwt.trading.client.StockQuote;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

/**
 * @author Iulian Costan (iulian.costan@gmail.com)
 *
 */
public interface TradingService extends RemoteService {

	public static final String ENTRY_POINT =  "/tradingservice";

	public StockQuote[] getQuotes(String symbol);
	
	public static class Util {
		public static TradingServiceAsync getInstance() {
			TradingServiceAsync instance = (TradingServiceAsync) GWT.create(TradingService.class);
			ServiceDefTarget target = (ServiceDefTarget) instance;
			target.setServiceEntryPoint(GWT.getModuleBaseURL() + ENTRY_POINT);
			return instance;
		}
	}

}
